﻿<s:SurfaceWindow x:Class="Samples.Panels.SurfaceWindowMain"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:s="http://schemas.microsoft.com/surface/2008"
                 xmlns:tk="clr-namespace:Black.SurfaceToolkit.Controls;assembly=Black.SurfaceToolkit"
                 Title="Samples.Panels">
    <s:SurfaceWindow.Resources>
        <ImageBrush x:Key="WindowBackground" Stretch="none" Opacity="0.6" ImageSource="pack://application:,,,/Resources/WindowBackground.jpg" />

        <Style TargetType="{x:Type GroupBox}">
            <Setter Property="BorderBrush" Value="DarkGray" />
        </Style>
        <Style TargetType="{x:Type s:SurfaceSlider}">
            <Setter Property="Margin" Value="10,0" />
        </Style>
        <Style TargetType="{x:Type s:SurfaceListBoxItem}">
            <Setter Property="TextBlock.Foreground" Value="White" />
            <!--<Setter Property="TextBlock.Foreground" Value="Black" />-->
        </Style>
    </s:SurfaceWindow.Resources>

    <!--TextBlock.Foreground="Black"-->

    <Grid Background="{StaticResource WindowBackground}" Width="1024" Height="768">
        <UniformGrid Rows="2">
            <GroupBox Header="ArcStackPanel" Margin="25,50,10,10">
                <DockPanel>
                    <StackPanel DockPanel.Dock="Bottom" Margin="0,20,0,0">
                        <TextBlock TextAlignment="Center" Text="{Binding ElementName=ArcStackPanel, Path=Distance, Mode=TwoWay, StringFormat='{}Distance ({0:0})'}" />
                        <s:SurfaceSlider Minimum="-1000" Maximum="1000" Value="{Binding ElementName=ArcStackPanel, Path=Distance, Mode=TwoWay}" />
                    </StackPanel>
                    <tk:ArcStackPanel Distance="500" x:Name="ArcStackPanel" Orientation="Horizontal">
                        <Rectangle Height="40" Width="65" Fill="Red" />
                        <Rectangle Height="40" Width="65" Fill="Green" />
                        <Rectangle Height="40" Width="65" Fill="Blue" />
                        <Rectangle Height="40" Width="65" Fill="Yellow" />
                        <Rectangle Height="40" Width="65" Fill="Brown" />
                        <Rectangle Height="40" Width="65" Fill="Purple" />
                    </tk:ArcStackPanel>
                </DockPanel>
            </GroupBox>

            <GroupBox Header="FillStackPanel" Margin="10,50,25,10">
                <DockPanel>
                    <StackPanel DockPanel.Dock="Bottom" Margin="0,20,0,0">
                        <TextBlock TextAlignment="Center">FillItemIndex</TextBlock>
                        <s:SurfaceSlider Minimum="-1" Maximum="5" Value="{Binding ElementName=FillStackPanel, Path=FillItemIndex, Mode=TwoWay}" IsSnapToTickEnabled="True" />
                    </StackPanel>
                    <Border BorderBrush="DarkGray" BorderThickness="1" Margin="10">
                        <tk:FillStackPanel x:Name="FillStackPanel" Orientation="Horizontal">
                            <Rectangle MinHeight="50" MinWidth="50" Fill="Red" />
                            <Rectangle MinHeight="50" MinWidth="50" Fill="Green" />
                            <Rectangle MinHeight="50" MinWidth="50" Fill="Blue" />
                            <Rectangle MinHeight="50" MinWidth="50" Fill="Yellow" />
                            <Rectangle MinHeight="50" MinWidth="50" Fill="Brown" />
                            <Rectangle MinHeight="50" MinWidth="50" Fill="Purple" />
                        </tk:FillStackPanel>
                    </Border>
                </DockPanel>
            </GroupBox>

            <GroupBox Header="StringPathPanel/PathPanel" Margin="25,10,10,50">
                <Grid VerticalAlignment="Center" Height="300" Width="300" HorizontalAlignment="Center">                    
                    <!--<Path Data="M51,34 C81.499931,112.50007 115.49985,42.500008 187.5,60.5 261.25637,78.939045 234.49984,130.50011 179.49984,150.50011 124.49984,170.50011 61.499976,121.50012 63.499972,162.50012 65.499967,203.50012 114.49969,246.50006 139.4998,234.50019 193.388,208.63425 201.49926,254.50006 187.49969,289.50034" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="None" Stroke="Black" />-->
                    <Path Data="M34,71 C112.50007,81.499931 42.500008,115.49985 60.5,187.5 78.939045,261.25637 130.50011,234.49984 150.50011,179.49984 170.50011,124.49984 121.50012,61.499976 162.50012,63.499972 203.50012,65.499967 246.50006,114.49969 234.50019,139.4998 208.63425,193.388 254.50006,201.49926 289.50034,187.49969" HorizontalAlignment="Left" VerticalAlignment="Top" Stretch="None" Stroke="Black" />
                    <tk:StringPathPanel PathLength="50" OffsetOrigin="50">
                        <tk:StringPathPanel.Path>
                            <PathGeometry>
                                <PathGeometry.Figures>
                                    <!--<PathFigure StartPoint="51,34">-->
                                    <PathFigure StartPoint="34,71">
                                        <PathFigure.Segments>
                                            <!--<PolyBezierSegment Points="81.499931,112.50007 115.49985,42.500008 187.5,60.5 261.25637,78.939045 234.49984,130.50011 179.49984,150.50011 124.49984,170.50011 61.499976,121.50012 63.499972,162.50012 65.499967,203.50012 114.49969,246.50006 139.4998,234.50019 193.388,208.63425 201.49926,254.50006 187.49969,289.50034" />-->
                                            <PolyBezierSegment Points="112.50007,81.499931 42.500008,115.49985 60.5,187.5 78.939045,261.25637 130.50011,234.49984 150.50011,179.49984 170.50011,124.49984 121.50012,61.499976 162.50012,63.499972 203.50012,65.499967 246.50006,114.49969 234.50019,139.4998 208.63425,193.388 254.50006,201.49926 289.50034,187.49969" />
                                        </PathFigure.Segments>
                                    </PathFigure>
                                </PathGeometry.Figures>
                            </PathGeometry>
                        </tk:StringPathPanel.Path>
                        <tk:StringPathPanel.Resources>
                            <Style TargetType="{x:Type Rectangle}">
                                <Setter Property="tk:StringPathPanel.FreeSpaceMode" Value="Fixed" />
                                <Setter Property="tk:StringPathPanel.PrecedingFreeSpace" Value="10.0" />
                                <Setter Property="Opacity" Value="0.7" />
                            </Style>
                        </tk:StringPathPanel.Resources>

                        <Rectangle Height="80" Width="50" Fill="Red" tk:StringPathPanel.Distance="0" />
                        <Rectangle Height="80" Width="50" Fill="Green" />
                        <Rectangle Height="80" Width="50" Fill="Blue" />
                        <Rectangle Height="80" Width="50" Fill="Yellow" />
                        <Rectangle Height="80" Width="50" Fill="Brown" />
                        <Rectangle Height="80" Width="50" Fill="Purple" />
                    </tk:StringPathPanel>
                </Grid>
            </GroupBox>

            <GroupBox Header="GrowingContainer" Margin="10,10,25,50">
                <DockPanel>
                    <UniformGrid DockPanel.Dock="Bottom" Margin="0,20,0,0" Rows="1">
                        <StackPanel>
                            <TextBlock TextAlignment="Center" Text="{Binding ElementName=GrowingContainer, Path=XExtension, Mode=TwoWay, StringFormat='{}Agrandissement selon X ({0:0.00})'}" />
                            <s:SurfaceSlider Minimum="0" Maximum="1" Value="{Binding ElementName=GrowingContainer, Path=XExtension, Mode=TwoWay}" />
                        </StackPanel>
                        <StackPanel>
                            <TextBlock TextAlignment="Center" Text="{Binding ElementName=GrowingContainer, Path=YExtension, Mode=TwoWay, StringFormat='{}Agrandissement selon Y ({0:0.00})'}" />
                            <s:SurfaceSlider Minimum="0" Maximum="1" Value="{Binding ElementName=GrowingContainer, Path=YExtension, Mode=TwoWay}" />
                        </StackPanel>
                    </UniformGrid>
                    <StackPanel DockPanel.Dock="Left" Margin="10,20" VerticalAlignment="Center">
                        <TextBlock TextAlignment="Center" Margin="0,0,0,5">Ancrage vertical</TextBlock>
                        <s:SurfaceListBox SelectedItem="{Binding ElementName=GrowingContainer, Path=VerticalContentAlignment, Mode=TwoWay}" Background="Transparent">
                            <x:StaticExtension Member="VerticalAlignment.Top" />
                            <x:StaticExtension Member="VerticalAlignment.Center" />
                            <x:StaticExtension Member="VerticalAlignment.Bottom" />
                        </s:SurfaceListBox>
                    </StackPanel>
                    <StackPanel DockPanel.Dock="Right" Margin="10,20" VerticalAlignment="Center">
                        <TextBlock TextAlignment="Center" Margin="0,0,0,5">Ancrage horizontal</TextBlock>
                        <s:SurfaceListBox SelectedItem="{Binding ElementName=GrowingContainer, Path=HorizontalContentAlignment, Mode=TwoWay}" Background="Transparent">
                            <x:StaticExtension Member="HorizontalAlignment.Left" />
                            <x:StaticExtension Member="HorizontalAlignment.Center" />
                            <x:StaticExtension Member="HorizontalAlignment.Right" />
                        </s:SurfaceListBox>
                    </StackPanel>
                    <Grid>
                        <Border BorderThickness="1" BorderBrush="DarkGray" VerticalAlignment="Center" HorizontalAlignment="Center">
                            <tk:GrowingContainer x:Name="GrowingContainer" VerticalContentAlignment="Center" HorizontalContentAlignment="Center">
                                <Border Height="150" Width="150" BorderThickness="1" CornerRadius="3">
                                    <Border.Background>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
                                            <GradientStop Color="Red" Offset="0.0" />
                                            <GradientStop Color="Green" Offset="0.2" />
                                            <GradientStop Color="Blue" Offset="0.4" />
                                            <GradientStop Color="Yellow" Offset="0.6" />
                                            <GradientStop Color="Brown" Offset="0.8" />
                                            <GradientStop Color="Purple" Offset="1.0" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                            </tk:GrowingContainer>
                        </Border>
                    </Grid>
                </DockPanel>
            </GroupBox>
        </UniformGrid>
    </Grid>
</s:SurfaceWindow>
